<?php
include 'dbconnect.php';
$query = 'SELECT * FROM players';
$result = mysqli_query($link, $query);
//$obj = mysqli_fetch_object($result);
echo "<table border='1' >";
echo "<tr><td>Name</td><td>lastupdate</td><td>x</td><td>y</td><td>life</td><td>attack</td><td>defense</td><td>xp</td></tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
  echo "<td>".$row['name']."</td><td>".$row['lastupdate']."</td><td>".$row['x']."</td><td>".$row['y']."</td><td>".$row['life']."</td><td>".$row['attack']."</td><td>".$row['defense']."</td><td>".$row['xp']."</td>";
  echo "</tr>";
}
echo "</table>";
echo "<hr>";
$query = 'SELECT * FROM enemies';
$result = mysqli_query($link, $query);
//$obj = mysqli_fetch_object($result);
echo "<table border='1' >";
echo "<tr><td>Name</td><td>type</td><td>x</td><td>y</td><td>defense</td><td>attack</td><td>life</td></tr>";
while($row = mysqli_fetch_array($result)) {
  echo "<tr>";
  echo "<td>".$row['name']."</td><td>".$row['type']."</td><td>".$row['x']."</td><td>".$row['y']."</td><td>".$row['defense']."</td><td>".$row['attack']."</td><td>".$row['life']."</td>";
  echo "</tr>";
}



mysqli_close($link);
?>